<?php
/*
$JA#COPYRIGHT$
*/


defined('_JEXEC') or die('Retricted Access');
if (! class_exists ( 'JAStack' )&&! class_exists ( 'SmartTrim' ))
	require_once(JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'helper'.DS.'jahelper.php');
global $jbconfig, $option;   
?>
<script type="text/javascript">
/* <![CDATA[ */
    function submitbutton(pressbutton,max){
    	
			if (pressbutton=='job_list_via_profiles')
	        	var form = document.emplForm;
	        else
	        	var form = document.adminForm;
	        	
	        form.task.value = pressbutton;
	        form.submit();
	    }
    window.addEvent('domready', function() {
        if( typeof (document.adminForm) == 'undefined' ){
            var form = document.getElementById('modListJob<?php echo $module->id;?>');                
            document.adminForm = form;
        }
    });
/* ]]> */
</script>
<div id="jobboard-content_1">
<!--	All Job List-->
	<!-- Edit by Duchh -->

	<form id="modListJob<?php echo $module->id;?>" name="modListJob<?php echo $module->id;?>" action="<?php echo JRoute::_('index.php');?>" method="get">
		<!--	BEGIN: All Job List-->
		<?php 
		$formName = "modListJob".$module->id;
		
		if(isset($this->fieldlist) && count($this->fieldlist)>0){
			jimport('joomla.filesystem.file');
			$theme = JRequest::getVar('theme');
			if (!$theme)
				$theme = $params->get('theme_name','use_component');
			if ($theme=='use_component')
				$theme = $jbconfig['general']->get('theme', 'default');
				
			$path = JPATH_SITE.DS.'components'.DS.'com_jajobboard'.DS.'views'.DS.'jajobs'.DS.'tmpl'.DS;
			if ($theme!='default')
				$path_themes = $path.'themes'.DS.$theme.DS.'jalist-item.php';
			else 	
				$path_themes = dirname(__FILE__).DS.'themes'.DS.'default'.DS.'jalist-item.php';
				
			if(JFile::exists($path_themes)){
				if(file_exists($path.'themes'.DS.$theme.DS.'style.css')){
			    	JHTML::stylesheet('style.css', "components/com_jajobboard/views/jajobs/tmpl/themes/$theme/");
			    }	
				include $path_themes;					
			}
			else{
				$path_themes = dirname(__FILE__).DS.'themes'.DS.'default'.DS.'jalist-item.php';
				if(file_exists($path_themes)){
			    	JHTML::stylesheet('style.css', dirname(__FILE__).DS.'themes'.DS.'default'.DS);
			    	include $path_themes;	
			    }	
				
			}

		}
		?>
		<!--	END: All Job List-->			
		
		<!--<input type="hidden" id="cids" name="cids[]" value="" />-->
	 	<input type="hidden" name="boxchecked" id="boxchecked<?php echo $formName;?>" value="0" />
	 	<input type="hidden" name="field" value="" />
	 	<input type="hidden" name="option" value="com_jajobboard" />
		<input type="hidden" name="view" value="jajobs" />
		<input type="hidden" name="layout" value="jalist" />
	    <input type="hidden" name="task" value="" />
		<input type="hidden" name="Itemid" value="<?php echo $this->Itemid?>" />
 </form>	
</div>